// Time Tracker by Eric Nadeau (nado18@gmail.com)
// Copyright (C) 2007 by Eric Nadeau
// Distributed under the terms of the GNU General Public License (see GPL.txt)

package view;

import java.awt.*;

import javax.swing.*;

/**
 * @author nado18@gmail.com, on Dec 29, 2005
 */
public class BooleanRenderer extends TableCells {
	private JCheckBox cb = new JCheckBox();

	public BooleanRenderer() {
		cb.setHorizontalAlignment( JCheckBox.CENTER );
	}
	
	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
		setColor(isSelected, row, cb);
		
		cb.setSelected( ((Boolean)value).booleanValue() );
		
		return cb;
	}
}
